<% form_for(@recipe) do |f| %>
<div id="nav_div"><span style='font-weight: bold; font-size: 10pt'>
<%= link_to 'Edit This Recipe', edit_recipe_path %> |&nbsp;
<%= link_to 'Back To Recipe Listings', recipes_path %>
<span></div>
<table id="main_table">
  <table id="three_column_table">
    
    <tr>
      <td id="center_column">
        
	<table id="new_recipe_table">
	<colgroup span='2'><col width='450'/><col width='450'/></colgroup>
	  
          <tr>
            <td colspan='2'><%=h @recipe.title %></td>
	  </tr>

	  <tr>
	    <td colspan='2'><p style="color: green"><%= flash[:notice] %></p></td>
	  </tr>
	  
	  <tr>

	    <td id="new_left_column">
	      
	      <table id="new_right_table">
	        
		<tr>
	          <td><b>Last Made</b></td>
	          <td><%= @recipe.lastdate %></td>
	        </tr>

	        <tr>
	          <td><b>Description</b></td>
	          <td><%= @recipe.description %></td>
	        </tr>

                <tr>
	          <td><b>Category</b></td>
	          <td><%= @recipe.category.category %></td>
	        </tr>
		
		<tr>
                  <td>
	            <b>Rating</b>
	          </td>
	          <td>
		      <% for i in (1..5) %>
		        <% if i == @recipe.rating %>
		        <%= radio_button("recipe", "rating", i, :class => "star", :disabled => "disabled", :checked => "checked") %>
		        <% else %>
		        <%= radio_button("recipe", "rating", i, :class => "star", :disabled => "disabled") %>
			<% end %>
		      <% end %>
	          </td>
	        </tr>

                <tr>
		  <td><b>Main Ingredient</b></td>
		  <td><%= @recipe.mainingredient %></td>
		</tr>
		
                <tr>
		  <td colspan='2' id='spacer_row'>
		    <br/>
		  </td>
		</tr>

		<tr>
		  <td style='vertical-align:top' colspan = 2>
		    <table>
		    <colgroup span='2'><col width='150'/><col width='150'/></colgroup>
		      <tr>
		        <td class='show_ingredients'><b>Ingredients</b></td>
		        <td class='show_ingredients'><b>Amounts</b></td>
		     </tr>
		     
		     <% @mynumber = 0 %>
		     <% @size.times do %>
		     <tr>
		       <td><%=h @mynumber + 1 %>)&nbsp;<%=h @ingredients[@mynumber].ingredient %></td>
		       <td><%=h @ingredients[@mynumber].amount %></td>
		     </tr>
		     
		     <% @mynumber += 1 %>
		     <% end %>

		    </table>
		  </td>

		</tr>
	      </table>
	    </td>

	    <td id="new_right_column">

              <table id="show_instructions_table">

		<tr>
		  <td style='vertical-align: top'>
		    Instructions<br/>
		    <div id="instructions">
		      <%= @recipe.instructions %>
		    </div>
		  </td>
		</tr>
	      </table>
	    </td>

	  </tr>
        </table>

      </td>
    
    </tr>
  </table>
</table>
<% end %>